# -*-coding:utf-8-*-

xiaoming_dict = {"name": "xiaoming", "age": 12}
xiaoming_dict["graduate"] = "MIT"
# 字典中键值对个数
print(len(xiaoming_dict))
print(xiaoming_dict)

# pop(key) 删除字典中的元素
xiaoming_dict.pop("age")
print(xiaoming_dict)

# update(字典) 合并字典
temp_dictionary = {"gender": "man", "name": "xiaoming"}
xiaoming_dict.update(temp_dictionary)
print(xiaoming_dict)

# clear 清空字典
temp_dictionary.clear()
print(temp_dictionary)

# 字典的遍历
for key in xiaoming_dict:
    print("%s => %s " % (key, xiaoming_dict[key]))
